package com.bfl.sa.sys.organization.converter;

import com.bfl.sa.sys.organization.entity.Organization;
import com.bfl.sa.sys.organization.service.OrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;

public class OrganizationConverter implements Converter<String, Organization> {

    @Autowired
    private OrganizationService organizationService;

    @Override
    public Organization convert(String id) {
        return organizationService.findOne(Long.parseLong(id));
    }
}
